<?php
/**
 * 奖品支付信息表
 */
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePrizePaymentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('prize_payments', function (Blueprint $table) {
            $table->uuid('id')->unique();//订单号
            $table->string('order_id');//真正的订单号
            $table->string('user_id');//用户ID
            $table->string('order_name');//订单名称
            $table->string('goods_name');//商品名称
            $table->integer('price');//订单单价
            $table->integer('number');//订单数量
            $table->string('description')->nullable();//订单描述
            $table->uuid('prize_id')->nullable();//奖品ID
            $table->integer('status')->default(0);//支付状态 0未支付 1已提交支付 2支付取消 3支付成功 4 支付结束 5支付失败 6退款提交 7退款完成
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('prize_payments', function (Blueprint $table) {
            $table->dropIfExists();
        });
    }
}
